package com.yang.lesson03;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

//画笔
public class TestPaint {
    public static void main(String[] args) {
        new MyPaint().loadFrame();
    }
}

class MyPaint extends Frame{
    public void loadFrame(){
        setBounds(200,200,500,500);
        setVisible(true);


    }

    @Override
    public void paint(Graphics g) {
        //画笔，需要有颜色，画笔可以画画
        g.setColor(Color.orange);
        g.fillOval(100,100,50,50);

        //养成习惯，画笔用完后要返回最初颜色
    }
}